﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace FlightTicketModel
{
    [DataContractAttribute(IsReference = true)]
    public class FlightTicketTask : EntityBase
    {
        public int AirlineID { get; set; }
        [MaxLength(3)]
        public string AirCode1 { get; set; } = "";
        [MaxLength(3)]
        public string AirCode2 { get; set; } = "";
        [MaxLength(3)]
        public string AirCode3 { get; set; } = "";
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? date1 { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? date2 { get; set; }
        [DataMember]
        public AirLineType AirLineType { get; set; } = AirLineType.OneWay;
        [DataMember]
        public List<FlightTicketChildTask> Tasks { get; set; } = new List<FlightTicketChildTask>();
    }
    /// <summary>
    /// 往返类型
    /// </summary>
    public enum AirLineType
    {
        /// <summary>
        /// 所有
        /// </summary>
        None = 0,
        /// <summary>
        /// 单程
        /// </summary>
        OneWay = 1,
        /// <summary>
        /// 往返
        /// </summary>
        Return = 2
    }
}
